<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta HTTP-EQUIV="pragma" CONTENT="no-cache">
    <meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
    <meta HTTP-EQUIV="expires" CONTENT="0">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>基础桩详情</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/font-awesome.css" rel="stylesheet">
    <link href="css/animate.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link href="css/ui.css" rel="stylesheet">
    <link href="css/layui.css" rel="stylesheet">
    <link href="css/control.css" rel="stylesheet">
    <style>
        #body {
            width: 100%;
            max-height: 100%;
            overflow-y: scroll;
            overflow-x: hidden;
        }

        .articleImg {
            /* width: 100%; */
            /* height: auto !important; */
            max-width: 100px;
        }

        th,
        td {
            text-align: center;
        }

        .textAreaBlock {
            margin-left: 130px;
            min-height: 36px;
        }

        .form_item_align_left {
            text-align: left;
        }

        .from_item_align_center {
            text-align: center;
        }
        img{
            width: 20%;
        }


    </style>
</head>

<body class="gray-bg animated fadeInRight">
<div id="body">
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">

                        <div id="content">

                            <fieldset style="margin-top: 20px">
                                <legend>基础信息</legend>
                            </fieldset>
                            <div style="float: right;margin-top: -50px">
                                <button id="flipthis" onclick="backForwardListen()" class="btn ">返回列表</button>
                            </div>


                            <div class="layui-form-item form_item_align_left">
                                <div class="layui-inline">
                                    <label class="layui-form-label">项目</label>
                                    <div class="layui-input-inline">
                                        <input type="text" readonly="readonly"  id="project_name"
                                               autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">区域</label>
                                    <div class="layui-input-inline">
                                        <input type="hidden"  id="pile_region_id"  class="layui-input">
                                        <input type="text" readonly="readonly"   id="regin_name"
                                               autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">单位名称</label>
                                    <div class="layui-input-inline">
                                        <input type="text" readonly="readonly" id="detection_unit" autocomplete="off"
                                               class="layui-input">
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item form_item_align_left">
                                <div class="layui-inline">
                                    <label class="layui-form-label">桩号</label>
                                    <div class="layui-input-inline">
                                        <input type="text" readonly="readonly" id="pile_number"
                                                autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">施工方提供桩长(m)</label>
                                    <div class="layui-input-inline">
                                        <input type="number" readonly="readonly" id="c_pile_length" lay-verify="date"
                                               autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">桩径(mm)</label>
                                    <div class="layui-input-inline">
                                        <input type="number" readonly="readonly" id="pile_diameter" lay-verify="date"
                                               autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item form_item_align_left">
                                <div class="layui-inline">
                                    <label class="layui-form-label">孔口高程</label>
                                    <div class="layui-input-inline">
                                        <input type="number" readonly="readonly" id="orifice_elevation" lay-verify="date"
                                               autocomplete="off" class="layui-input">
                                    </div>
                                </div>

                                <div class="layui-inline layui-form">
                                    <label class="layui-form-label">混凝土设计强度等级</label>
                                    <div class="layui-input-inline">
                                        <select id="concrete_design_grade"  disabled="disabled">
                                            <option value="0" selected="">C20</option>
                                            <option value="1">C25</option>
                                            <option value="2">C30</option>
                                            <option value="3">C35</option>
                                            <option value="4">C40</option>
                                            <option value="5">C45</option>
                                            <option value="6">C50</option>
                                            <option value="7">C55</option>
                                            <option value="8">C60</option>
                                            <option value="9">C65</option>
                                            <option value="10">C70</option>
                                            <option value="11">C75</option>
                                            <option value="12">C80</option>
                                        </select>
                                    </div>
                                </div>

                                <div class="layui-inline layui-form">
                                    <label class="layui-form-label">声波透射法检测桩身完整性类别</label>
                                    <div class="layui-input-inline ">
                                        <select name="pileIntegrity" id="p_pile_integrity" disabled="disabled">
                                            <option value="0" selected="true">未填写</option>
                                            <option value="1">I</option>
                                            <option value="2">II</option>
                                            <option value="3">III</option>
                                            <option value="4">IV</option>
                                        </select>
                                    </div>
                                </div>
                            </div>


                            <div class="layui-form-item form_item_align_left">
                                <div class="layui-inline">
                                    <label class="layui-form-label">浇筑时间</label>
                                    <div class="layui-input-inline">
                                        <input type="text" class="layui-input" id="casting_time" readonly="readonly"  placeholder="yyyy-MM-dd">
                                    </div>
                                </div>

                                <!--<div class="layui-inline">-->
                                    <!--<label class="layui-form-label">混凝土强度(MPa)</label>-->
                                    <!--<div class="layui-input-inline">-->
                                        <!--<input type="number" readonly="readonly" id="concrete_strength"-->
                                               <!--lay-verify="date" autocomplete="off" class="layui-input">-->
                                    <!--</div>-->
                                <!--</div>-->

                                <div class="layui-inline layui-form">
                                    <label class="layui-form-label">沉渣厚度是否满足设计要求</label>
                                    <div class="layui-input-inline">
                                        <select id="sediment_thickness_status" disabled="disabled">
                                            <option value="0" selected="">未填写</option>
                                            <option value="1">是</option>
                                            <option value="2">否</option>
                                        </select>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item form_item_align_left">

                                <div class="layui-inline layui-form">
                                    <label class="layui-form-label">桩身完整性</label>
                                    <div class="layui-input-inline ">
                                        <select id="d_pile_integrity" disabled="disabled">
                                            <option value="0" selected="true">未填写</option>
                                            <option value="1">I</option>
                                            <option value="2">II</option>
                                            <option value="3">III</option>
                                            <optdidion value="4">IV</optdidion>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline layui-form">
                                    <label class="layui-form-label">持力层是否满足设计要求</label>
                                    <div class="layui-input-inline ">
                                        <select id="bearing_layer_status" disabled="disabled">
                                            <option value="0" selected="">未填写</option>
                                            <option value="1">是</option>
                                            <option value="2">否</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-inline layui-form">
                                    <label class="layui-form-label">总体判定是否满足设计要求</label>
                                    <div class="layui-input-inline ">
                                        <select id="status" disabled="disabled">
                                            <option value="0" selected="true">未填写</option>
                                            <option value="1">是</option>
                                            <option value="2">否</option>
                                        </select>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-form-item form_item_align_left">

                                <!--<div class="layui-inline">-->
                                    <!--<label class="layui-form-label">桩身混泥土描述</label>-->
                                    <!--<div class="layui-input-inline" style="width: 525px">-->
                                        <!--<textarea id="description_pile_concrete_description" readonly="readonly"-->
                                                  <!--class="layui-textarea"></textarea>-->
                                    <!--</div>-->
                                <!--</div>-->
                                <!--<div class="layui-inline">-->
                                    <!--<label class="layui-form-label">持力层描述</label>-->
                                    <!--<div class="layui-input-inline" style="width: 525px">-->
                                        <!--<textarea id="bearing_layer_description" readonly="readonly"-->
                                                  <!--class="layui-textarea"></textarea>-->
                                    <!--</div>-->
                                <!--</div>-->

                            </div>

                            <fieldset style="margin-top: 20px">
                                <legend>钻孔信息</legend>
                            </fieldset>

                            <!--<div class="zuankong" id="zuankong">
                                <div class="layui-form-item form_item_align_left">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">钻孔编号</label>
                                        <div class="layui-input-inline">
                                            <input type="text" readonly="readonly" name="drilling_no"
                                                   lay-verify="required|number" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <label class="layui-form-label">开孔日期</label>
                                    <div class="layui-input-inline">
                                        <input type="text" readonly="readonly" class="layui-input"
                                               name="open_drilling_time"/>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">钻机编号</label>
                                        <div class="layui-input-inline">
                                            <input type="text" readonly="readonly" name="rig_no"
                                                   lay-verify="required|number" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">终孔深度(m)</label>
                                        <div class="layui-input-inline">
                                            <input type="number" name="end_hole_depth" lay-verify="required|number"
                                                   readonly="readonly" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item form_item_align_left">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">桩长(m)</label>
                                        <div class="layui-input-inline">
                                            <input type="number" name="a_actual_pile_length"
                                                   lay-verify="required|number" readonly="readonly" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">混凝土芯样长度(m)</label>
                                        <div class="layui-input-inline">
                                            <input type="number" name="concrete_length" lay-verify="required|number"
                                                   readonly="readonly" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">桩身混凝土采取率(%)</label>
                                        <div class="layui-input-inline">
                                            <input type="number" name="pile_concrete_yield" lay-verify="required|number"
                                                   readonly="readonly" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">沉渣厚度(mm)</label>
                                        <div class="layui-input-inline">
                                            <input type="number" name="sediment_thickness" lay-verify="required|number"
                                                   readonly="readonly" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                </div>
                                <div class="layui-form-item form_item_align_left">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">持力层钻进深度(m)</label>
                                        <div class="layui-input-inline">
                                            <input type="number" name="drilling_depth_bearing_stratum"
                                                   lay-verify="required|number" readonly="readonly" autocomplete="off"
                                                   class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">持力层芯样长度(m)</label>
                                        <div class="layui-input-inline">
                                            <input type="number" name="bearing_core_length" lay-verify="required|number"
                                                   readonly="readonly" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="hr-line-dashed"></div>
                                </div>

                            </div>-->
                        </div>
                        <div class="from_item_align_center">
                            <button class="btn btn-info layui-btn-normal" onclick="backForwardListen()"
                                    style="margin-left: 20px">返&nbsp;&nbsp;&nbsp;&nbsp;回
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/work/common.js"></script>
<script src="js/plugins/laydate/laydate.js"></script>
<script src="js/plugins/layer/layer.min.js"></script>
<script src="js/plugins/layer/layer.js"></script>
<script src="js/layui.js"></script>

<!-- 自定义js -->
<script src="js/content.js"></script>
<script src="js/pileEdit.js"></script>
<script>
    /*layui.use('laydate', function(){
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
            elem: '#casting_time'
        });
        laydate.render({
            elem: "input[name='open_drilling_time']"
        });

    })*/
    var form=null;
    layui.use(['form'], function () {
        form = layui.form;
    });
    var pileId = getStorage("pileId");
    $(document).ready(function () {
        setTimeout(function () {
            initPileDetail();
        },200)
    });

    function initPileDetail() {
        ajax({
            url: "pile/showPileDetail",
            type: "POST",
            dataType: "json",
            xhrFields: {
                withCredentials: true
            },
            crossDomain: true,
            data: JSON.stringify({pileId: pileId}),
            timeout: 10000,
            contentType: "application/json;charset=utf-8",
            error: function (xhr, type) {
                layer.msg("服务器异常，请稍后重试！", {time: 2000})
            },
            successx: function (data) {
                if (data.success == true) {
                    setPileInfo(data.data);
                } else {
                    layer.msg(data.message, {time: 1000})
                }
            }
        });
    }

    // 初始化信息展示
    function setPileInfo(data) {
        if (data == null) {
            return;
        }
        if (data.tPile != null) {
            $("#detection_unit").val(data.tPile.detectionUnit);   //检测单位
            $("#pile_number").val(data.tPile.pileNumber);  //桩号
            $("#c_pile_length").val(data.tPile.cPileLength);  //施工方提供桩长(m)
            $("#pile_diameter").val(data.tPile.pileDiameter);  //桩径
            $("#orifice_elevation").val(data.tPile.orificeElevation);  //孔口高程
            $("#concrete_design_grade").val(data.tPile.concreteDesignGrade); //混凝土设计强度等级，0：C20,1:C30,2:C40,3:C50,4:C60,5:C70,6:C80'
            $("#p_pile_integrity").val(data.tPile.pPileIntegrity);  //声波透射法检测桩身完整性类别
            $("#casting_time").val(timeStamp2String(new Date(data.tPile.castingTime).getTime(), "ymd"));  //浇筑时间
            // $("#concrete_strength").val(data.tPile.concreteStrength)  //混泥土强度（MPa）
            $("#sediment_thickness_status").val(data.tPile.sedimentThicknessStatus);  //沉渣厚度是否满足设计要求
            $("#d_pile_integrity").val(data.tPile.dPileIntegrity);  //桩身完整性
            $("#bearing_layer_status").val(data.tPile.bearingLayerStatus);  //持力层是否满足设计要求
            // $("#description_pile_concrete_description").val(data.tPile.descriptionPileConcreteDescription);  //桩身混泥土描述
            // $("#bearing_layer_description").val(data.tPile.bearingLayerDescription);  //持力层描述
            $("#status").val(data.tPile.status);  //总体判定是否满足设计要求
            showProjectNameAndRegionName(data.tPile.pileRegionId);
        }
        //钻孔信息
        if (data.tDrillingDetails != undefined || data.tDrillingDetails.length != 0) {
            appendDrilling(data.tDrillingDetails);
        }
        form.render();
        //layui.form.render('select'); //刷新select选择框渲染
        /*$("#realName").val(data.realName);
        $("#mobile").val(data.mobile);
        $("#email").val(data.email);
        $("#createTime").val(timeStamp2String(data.createTime, "ymdhms"));
        $("#lastLoginTime").val(timeStamp2String(data.lastLoginTime, "ymdhms"));
        $("#appRole").val(data.appRoleName);
        $("#pcRole").val(data.pcRoleName);
        $("#accountStatus").val(data.accountStatus);
        layui.form.render('select'); //刷新select选择框渲染*/

        // $(".accountStatus").find('option[value='+data.accountStatus+']').attr("selected",true);
    }

    function appendDrilling(obj) {
        for (var i = 0; i < obj.length; i++) {
            var data = obj[i];

            var appendHtml = '<div class="zuankong" id="zuankong">' +
                '                                    <div class="layui-form-item form_item_align_left">' +
                '                                        <div class="layui-inline">' +
                '                                            <label class="layui-form-label">钻孔编号</label>' +
                '                                            <div class="layui-input-inline">' +
                '                                                <input type="hidden" readonly="readonly" value=' + data.id + ' name="id" class="layui-input" >' +
                '                                                <input type="text" readonly="readonly" value=' + data.drillingNo + ' name="drilling_no" lay-verify="required|number" autocomplete="off" class="layui-input" >' +
                '                                            </div>' +
                '                                        </div>' +
                '                                        <div class="layui-inline">' +
                '                                            <label class="layui-form-label">开孔日期</label>' +
                '                                            <div class="layui-input-inline">' +
                '                                                <input type="text" readonly="readonly" value="' + timeStamp2String(new Date(data.openDrillingTime).getTime(), "ymd") + '" class="layui-input" name="open_drilling_time" placeholder="yyyy-MM-dd" id="data.openDrillingTime">' +
                '                                            </div>' +
                '                                        </div>' +
                '                                        <div class="layui-inline">' +
                '                                            <label class="layui-form-label">钻机编号</label>' +
                '                                            <div class="layui-input-inline">' +
                '                                                <input type="text" readonly="readonly" value="' + setNull(data.rigNo) + '" name="rig_no" lay-verify="required|number" autocomplete="off" class="layui-input">' +
                '                                            </div>' +
                '                                        </div>' +
                '                                        <div class="layui-inline">' +
                '                                            <label class="layui-form-label">终孔深度</label>' +
                '                                            <div class="layui-input-inline">' +
                '                                                <input type="text" readonly="readonly" value="' + undeToNull(data.endHoleDepth) + '"   name="end_hole_depth" lay-verify="required|number" autocomplete="off" class="layui-input">' +
                '                                            </div>' +
                '                                        </div>' +
                '                                        <div class="layui-inline">' +
                '                                            <label class="layui-form-label">终孔日期</label>' +
                '                                            <div class="layui-input-inline">' +
                '                                                <input type="text" readonly="readonly" value="' + timeStamp2String(new Date(data.closeDrillingTime).getTime(), "ymd") + '" class="layui-input" name="close_drilling_time" placeholder="yyyy-MM-dd" id="data.closeDrillingTime">' +
                '                                            </div>' +
                '                                        </div>' +
                '                                        <div class="layui-inline">' +
                '                                               <label class="layui-form-label">混凝土强度(MPa)</label>' +
                '                                               <div class="layui-input-inline">' +
                '                                                   <input type="number" readonly="readonly" value="' + undeToNull(data.concreteStrength) + '"  lay-verify="date" autocomplete="off" class="layui-input">' +
                '                                               </div>' +
                '                                        </div>' +
                '                                        <div class="layui-form-item form_item_align_left">' +
                '                                        <div class="layui-inline">' +
                '                                           <label class="layui-form-label">桩长(m)</label>' +
                '                                           <div class="layui-input-inline">' +
                '                                               <input type="number" readonly="readonly" value=' + data.aActualPileLength + ' name="a_actual_pile_length" lay-verify="required|number" placeholder="请填写数字" autocomplete="off" class="layui-input">' +
                '                                           </div>' +
                '                                        </div>' +
                '                                       <div class="layui-inline">' +
                '                                           <label class="layui-form-label">混凝土芯样长度(m)</label>' +
                '                                           <div class="layui-input-inline">' +
                '                                               <input type="number" readonly="readonly" value=' + data.concreteLength + ' name="concrete_length" lay-verify="required|number" placeholder="请填写数字" autocomplete="off" class="layui-input">' +
                '                                           </div>' +
                '                                       </div>' +
                '                                       <div class="layui-inline">' +
                '                                       <label class="layui-form-label">桩身混凝土采取率(%)</label>' +
                '                                       <div class="layui-input-inline">' +
                '                                               <input type="number" readonly="readonly" value=' + data.pileConcreteYield + ' name="pile_concrete_yield" lay-verify="required|number" placeholder="请填写数字" autocomplete="off" class="layui-input">' +
                '                                           </div>' +
                '                                       </div>' +
                '                                       <div class="layui-inline">' +
                '                                           <label class="layui-form-label">沉渣厚度(mm)</label>' +
                '                                           <div class="layui-input-inline">' +
                '                                               <input type="number" readonly="readonly" value=' + data.sedimentThickness + ' name="sediment_thickness" lay-verify="required|number" placeholder="请填写数字" autocomplete="off" class="layui-input">' +
                '                                           </div>' +
                '                                       </div>' +
                '                                       </div>' +
                '                                       <div class="layui-form-item form_item_align_left">' +
                '                                           <div class="layui-inline">' +
                '                                               <label class="layui-form-label">桩身混凝土描述</label>' +
                '                                                   <div class="layui-input-inline" style="width: 525px">' +
                '                                                       <textarea readonly="readonly" class="layui-textarea">'+ undeToNull(data.descriptionPileConcreteDescription) +'</textarea>' +
                '                                                   </div>' +
                '                                                   </div>' +
                '                                                   <div class="layui-inline">' +
                '                                                       <label class="layui-form-label">持力层描述</label>' +
                '                                                       <div class="layui-input-inline" style="width: 525px">' +
                '                                                       <textarea readonly="readonly" class="layui-textarea">' + undeToNull(data.bearingLayerDescription) +'</textarea>' +
                '                                                   </div>' +
                '                                               </div>' +
                '                                       </div>' +
                '                                       <div class="layui-form-item form_item_align_left">' +
                '                                       <div class="layui-inline">' +
                '                                           <label class="layui-form-label">持力层钻进深度(m)</label>' +
                '                                       <div class="layui-input-inline">' +
                '                                               <input type="number" readonly="readonly" value=' + data.drillingDepthBearingStratum + ' name="drilling_depth_bearing_stratum" lay-verify="required|number" placeholder="请填写数字" autocomplete="off" class="layui-input">' +
                '                                           </div>' +
                '                                       </div>' +
                '                                       <div class="layui-inline">' +
                '                                           <label class="layui-form-label">持力层芯样长度(m)</label>' +
                '                                       <div class="layui-input-inline">' +
                '                                               <input type="number" readonly="readonly" value=' + data.bearingCoreLength + ' name="bearing_core_length" lay-verify="required|number" placeholder="请填写数字" autocomplete="off" class="layui-input">' +
                '                                       </div>' +
                '                                       </div>' +
                '                                       <div class="layui-inline">' +
                '                                       <div class="layui-upload-list">' +
                '                                       <img src="' + picPath + '' + data.cordImg + '" class="layui-upload-img img-brower" style="max-height: 500px;" >' +
                '                                       <p></p>' +
                '                                       </div>' +
                '                                       </div>' +
                '                                       <div class="hr-line-dashed"></div>' +
                '                                       </div>' +
                '                                </div>';

            $("#content").append(appendHtml);


        }

    }


    function showProjectNameAndRegionName(regionId) {
        ajax({
            url: "pile/showProjectAndRegion",
            type: "GET",
            dataType: 'jsonp',
            jsonp: "callback",
            async: false,
            data: {regionId:regionId},
            timeout: 8000,
            error: function (xhr, type) {
                layer.msg("服务器异常，请稍后重试！", {time:2000})
            },
            successx: function (data) {
                if (data.success == true) {
                    setRegoin(data.data);
                } else {
                    layer.msg(data.message, {time: 1000})
                }
            }
        });

    }


    function setRegoin(data) {
        if (data!=null && data.tPileProject!=null && data.tPileRegion!=null) {
            $("#project_name").val(data.tPileProject.name);
            $("#regin_name").val(data.tPileRegion.name);
        }
    }

</script>

</body>

</html>